//
//  YTCountryCodeModel.h
//  YiTuUserClient
//
//  Created by 石少庸 on 2017/2/22.
//  Copyright © 2017年 YiTu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Realm/Realm.h>
@interface YTCountryCodeModel : RLMObject

//areaCode = 853;
//firstChar = z;
//id = 4588;
//"name_cn" = "\U4e2d\U56fd\U6fb3\U95e8";
//"name_en" = Macao;

/** 中文名称*/
@property (copy, nonatomic) NSString *nameChs;

/** 英文名称*/
@property (copy, nonatomic) NSString *nameEn;

/** 区号代码*/
@property (copy, nonatomic) NSString *areaCode;

/** 首字母*/
@property (copy, nonatomic) NSString *firstChar;

/** id*/
@property (copy, nonatomic) NSString *countryCodeId;

/** 跟id一样,不知道干啥用的*/
@property (copy, nonatomic) NSString *locationId;
@end

RLM_ARRAY_TYPE(YTCountryCodeModel)

@interface YTCountryCodeModelCache : NSObject

/**
 缓存

 @param codeArray model数组
 */
+ (void)cacheCountryCode:(NSArray<YTCountryCodeModel *> *)codeArray;

/**
 读取数据

 @param completion 数据回调
 */
+ (void)readObjectCompletion:(void(^)(NSArray<YTCountryCodeModel *> *codeArray))completion;

/**
 搜索

 @param whereAssert 查询断言
 @param completion 数据回调
 */
+ (void)searchObjectsWhere:(NSString *)whereAssert
                completion:(void(^)(NSArray<YTCountryCodeModel *> *searchArray))completion;

@end
